Add submission package for microsoft/TypeScript #55091 - #36
Conversation
Prepared fix, regression test, PR body and verification record for the enum non-finite constant emit bug. Not yet submitted upstream.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
GHSA-2v37-7h3g-55p8 raised the patched floor for nanoid to >=3.3.18, so the 3.3.17 override pinned in #35 now fails the production dependency audit. The advisory reaches the graph transitively through next > postcss > nanoid. Bump the existing override in pnpm-workspace.yaml, keep package.json in sync, and regenerate the lockfile.
|
The This was not caused by this PR: the commit under test added three files under
Verified locally, reproducing the failure first and then the fix:
One step I could not run here: Generated by Claude Code |
Stores the prepared upstream contribution for microsoft/TypeScript#55091 so it survives this session's container.
What's here
contrib/typescript-55091/contains:fix.patch- the change againstmicrosoft/TypeScriptmain(the Go compiler)PR_BODY.md- the upstream PR description, including the AI-assistance disclosure that repo'sCONTRIBUTING.mdrequiresREADME.md- reproduction, root cause, verification performed, submission steps, and an honest merge-probability assessmentThe bug
constantExpression()intsc/internal/transformers/tstransforms/utilities.goemitted bareInfinity/-Infinity/NaNidentifiers for enum members whose initializers fold to those values. Identifiers resolve in the emitted code's scope, so a local binding that shadows them silently changes the value. Reproduced on published TypeScript 7.0.2:No diagnostic is issued.
const enumis guarded by TS2477/TS2478; plainenumis not. The fix emits1 / 0,-1 / 0, and0 / 0, which cannot be shadowed.Verification
go build ./...clean;go test ./internal/testrunner/ -run TestLocalpasses with updated baselines;go test ./...62 packages pass, withinternal/astnavfailing on a missingnode_modules/typescript— confirmed identical with the fix stashed.gofmt -landgo vetclean. Patched compiler built and diffed before/after on the real repro.Not run: the
npx herebywrappers, as npm dependencies were not installed here.Not submitted upstream
microsoft/TypeScript's
CONTRIBUTING.mdaccepts a PR only where "a specific human operator has chosen this specific issue, intends to shepherd the change through review themselves, and will be the one responding to feedback in their own personal workflow," and requires disclosed AI assistance. Submission is therefore a manual step — steps are incontrib/typescript-55091/README.md.Generated by Claude Code